﻿// 标准管理平台

using DocumentFormat.OpenXml.Drawing;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Passion.iWMS.Application;

/// <summary>
/// 2 入库动作
/// 2.2 入库完成
/// 自動倉入料完成後通知上位系統
/// 
/// 存放完後,把所有相關數據上傳,確保正確性。
/// 若異常，則需要傳送錯誤代碼(EndCode)及錯誤原因(EndReason)；若完成入庫，錯誤代碼為0。 
/// 
/// API名稱: [POST] /api/WCS/StockInCompleted
/// ASRS -> Host
/// </summary>
[SugarTable("Host_StockInCompleted", "入库完成")]
[IncreTable]
public class Host_StockInCompleted_2_2 : EntityBase
{
    /// <summary>
    /// 搬送命令代碼
    /// </summary>
    [SugarColumn(ColumnDescription = "搬送命令代碼", Length = 50)]
    [MaxLength(50)]
    public string CommandID { get; set; }

    /// <summary>
    /// 入庫品項代碼
    /// </summary>
    [SugarColumn(ColumnDescription = "入庫品項代碼", Length = 50)]
    [MaxLength(50)]
    public string RegisterID { get; set; }

    /// <summary>
    /// 入庫口代碼
    /// </summary>
    [SugarColumn(ColumnDescription = "入庫口代碼", Length = 50)]
    [MaxLength(50)]
    public string PortID { get; set; }

    /// <summary>
    /// 任務狀態
    ///   0: Normal end --- 正常入庫完成
    ///   1: Abnormal end --- 系統自動判斷取消入料
    ///   2: Abort end --- 人員介入中止入料
    /// </summary>
    [SugarColumn(ColumnDescription = "任務狀態", Length = 50)]
    [MaxLength(50)]
    public string EndCode { get; set; }

    /// <summary>
    /// 結束原因
    /// </summary>
    [SugarColumn(ColumnDescription = "結束原因", Length = 50)]
    [MaxLength(50)]
    public string EndReason { get; set; }

    /// <summary>
    /// 是否上传
    /// </summary>
    [SugarColumn(ColumnDescription = "是否上传", Length = 50)]
    [MaxLength(50)]
    public string IsReport { get; set; }
    /// <summary>                                                                                                                                                                                                                                                                                                                       
    /// 备注
    /// </summary>
    [SugarColumn(ColumnDescription = "备注", Length = 5000)]
    [MaxLength(5000)]
    public string ReportRemarks { get; set; }

    /// <summary>
    /// 返回后是否处理
    /// </summary>
    [SugarColumn(ColumnDescription = "返回后是否处理", Length = 50)]
    [MaxLength(50)]
    public string IsResponse { get; set; }
    /// <summary>
    /// 返回消息体
    /// </summary>
    [SugarColumn(ColumnDescription = "返回消息体", Length = 50)]
    [MaxLength(50)]
    public string ResponseContent { get; set; }
}

public class Host_StockInCompleted_2_2_ResponseDTO
{
    public string Result { get; set; }
    public string ReturnMsg { get; set; }
}
